<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>net snmp | Matrix207&#39;s Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="1.Architecture1.1 Agent ArchitectureUpon starting, the agent goes through the following steps (in SnmpDaemonMain()):

reads command line options
decides whether it’s a master or subagent
calls init_ag">
<meta property="og:type" content="article">
<meta property="og:title" content="net snmp">
<meta property="og:url" content="http://yoursite.com/2013/04/19/net-snmp/index.html">
<meta property="og:site_name" content="Matrix207's Blog">
<meta property="og:description" content="1.Architecture1.1 Agent ArchitectureUpon starting, the agent goes through the following steps (in SnmpDaemonMain()):

reads command line options
decides whether it’s a master or subagent
calls init_ag">
<meta property="og:updated_time" content="2016-07-17T14:33:55.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="net snmp">
<meta name="twitter:description" content="1.Architecture1.1 Agent ArchitectureUpon starting, the agent goes through the following steps (in SnmpDaemonMain()):

reads command line options
decides whether it’s a master or subagent
calls init_ag">
  
    <link rel="alternate" href="/atom.xml" title="Matrix207&#39;s Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Matrix207&#39;s Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="Flux RSS"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Rechercher"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-net-snmp" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2013/04/19/net-snmp/" class="article-date">
  <time datetime="2013-04-18T16:00:00.000Z" itemprop="datePublished">2013-04-19</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/network/">network</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      net snmp
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="1-Architecture"><a href="#1-Architecture" class="headerlink" title="1.Architecture"></a>1.Architecture</h2><h4 id="1-1-Agent-Architecture"><a href="#1-1-Agent-Architecture" class="headerlink" title="1.1 Agent Architecture"></a>1.1 Agent Architecture</h4><p>Upon starting, the agent goes through the following steps (in SnmpDaemonMain()):</p>
<ul>
<li>reads command line options</li>
<li>decides whether it’s a master or subagent</li>
<li>calls init_agent()<ul>
<li>initializes the mib-module registration tree</li>
<li>registers its own configuration file tokens and callbacks</li>
<li>initializes the Agent Helpers </li>
</ul>
</li>
<li>initializes all the compiled-in mib modules</li>
<li>initializes the base libnetsnmp library</li>
<li>opens all the required ports to listen on</li>
<li>forks</li>
<li>saves persistent data (it’s likely at least something has changed already)</li>
<li>sends a coldStart trap</li>
<li>invokes receive() to perform the main packet handling </li>
</ul>
<p>Reference: <a href="http://www.net-snmp.org/wiki/index.php/Agent_Architecture" target="_blank" rel="external">Agent_Architecture</a></p>
<h4 id="1-2-snmpget-snmpset-snmpwalk-snmptrap"><a href="#1-2-snmpget-snmpset-snmpwalk-snmptrap" class="headerlink" title="1.2 snmpget snmpset snmpwalk snmptrap"></a>1.2 snmpget snmpset snmpwalk snmptrap</h4><p>Reference: <a href="http://www.net-snmp.org/wiki/index.php/TUT:mib2c_General_Overview" target="_blank" rel="external">mib2c_General_Overview</a></p>
<pre><code>* snmptranslate: learning about the MIB tree.
* snmpget:       retrieving data from a host.
* snmpgetnext:   retrieving unknown indexed data.
* snmpwalk:      retrieving lots of data at once!
* snmptable:     displaying a table.
* snmpset:       peforming write operations.
* snmpbulkget:   communicates with a network entity using SNMP GETBULK request
* snmpbulkwalk:  retrieve a sub-tree of management values using SNMP GETBULK requests.
* snmptrap:      sending traps messages, and acting upon them.
* snmptrapd:     receive and logs SNMP TRAP and INFORM messages.  

for more, use &apos;man&apos; command to see usage.
</code></pre><p>example: </p>
<pre><code>#### snmpwalk
[dennis@localhost ~]$ snmpwalk -v2c -c public 192.168.110.98 .1.3.6.1.4.1.50369
...
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.3.1 = INTEGER: 856398
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.4.1 = INTEGER: 432164
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.5.1 = INTEGER: 424234
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.6.1 = INTEGER: 1
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.7.1 = INTEGER: 3
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.8.1 = STRING: &quot;0:1 0:2 0:3 &quot;
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.9.1 = INTEGER: 3
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.10.1 = INTEGER: 0
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.11.1 = INTEGER: 4
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.12.1 = INTEGER: 0
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.13.1 = INTEGER: 5

#### snmpget
[dennis@localhost ~]$ snmpget -v2c -c public 192.168.110.98 .1.3.6.1.4.1.50369.1.1.2.5.1.3.1
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.3.1 = INTEGER: 856398

[dennis@localhost ~]$ snmpget -v2c -c public 192.168.110.98 .1.3.6.1.4.1.50369.1.1.2.5.1.8.1
SNMPv2-SMI::enterprises.50369.1.1.2.5.1.8.1 = STRING: &quot;0:1 0:2 0:3 &quot;

#### snmpset
[dennis@localhost ~]$ snmpset -v2c -c private 192.168.110.98 .1.3.6.1.4.1.50369.1.1.1.3.1.0 i 2
SNMPv2-SMI::enterprises.50369.1.1.1.3.1.0 = INTEGER: 2

[dennis@localhost ~]$ snmpset -v2c -c private 192.168.110.98 .1.3.6.1.4.1.50369.1.1.1.3.2.0 s &quot;2013-08-16 15:32:40&quot;
SNMPv2-SMI::enterprises.50369.1.1.1.3.2.0 = STRING: &quot;2013-08-16 15:32:40&quot;

#### snmptrap
# use snmptrapd to receive trap message.
# 1.first create file &quot;touch /usr/local/share/snmp/snmptrapd.conf&quot; 
# 2.then add &quot;authcommunity execute,log,net public&quot; to the file to access 
#   receive trap message.
# (use command &apos;snmpconf&apos; to create and config is another choise)
# use root to start snmptrapd 
[root@localhost ~]# snmptrapd -f -Le -F &quot;%02.2h:%02.2j TRAP%w.%q from %b\n %v\n&quot;
NET-SNMP version 5.7.2
14:30 TRAP0.0 from UDP: [192.168.110.39]:52222-&gt;[192.168.50.63]:162
 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1) 0:00:00.01    SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.50369.1.3.0.1    SNMPv2-SMI::enterprises.50369.1.1.2 = INTEGER: 1
15:38 TRAP0.0 from UDP: [172.16.110.39]:35505-&gt;[172.16.50.63]:162
 SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.50369    SNMPv2-SMI::enterprises.50369.1.1.2 = STRING: &quot;string value test&quot;    

root:~# snmptrap -v 2c -c public 192.168.50.63 1 .1.3.6.1.4.1.50369.1.3.0.1 .1.3.6.1.4.1.50369.1.1.2 i 1
root:~# snmptrap -v 2c -c public 192.168.50.63 &quot;abc&quot; .1.3.6.1.4.1.50369 .1.3.6.1.4.1.50369.1.1.2 s &quot;string value test&quot;
</code></pre><h2 id="2-Install"><a href="#2-Install" class="headerlink" title="2. Install"></a>2. Install</h2><h4 id="2-1-Yum"><a href="#2-1-Yum" class="headerlink" title="2.1 Yum"></a>2.1 Yum</h4><p><strong>install snmp</strong><br><code>su -c &#39;yum install net-snmp&#39;</code></p>
<p><strong>install mib2c</strong><br><code>su -c &#39;yum install net-snmp-perl&#39;</code></p>
<p><strong>install utils tools</strong>:snmpwalk, snmpget,…<br><code>su -c &#39;yum install net-snmp-utils&#39;</code></p>
<h2 id="3-Steps"><a href="#3-Steps" class="headerlink" title="3. Steps"></a>3. Steps</h2><h4 id="3-1-net-snmp中如何加自定义的mib库"><a href="#3-1-net-snmp中如何加自定义的mib库" class="headerlink" title="3.1 net-snmp中如何加自定义的mib库"></a>3.1 <a href="http://bbs.csdn.net/topics/300080590" target="_blank" rel="external">net-snmp中如何加自定义的mib库</a></h4><ul>
<li>Write your self-defined mibs</li>
<li>Copy to /usr/local/share/snmp/mibs</li>
<li>用snmptranslate -Ts -m ALL 就可以看到所以OID的输出了，当然也包括你新加的。<br>如果写的mib文件不正确，应该不能输出，你可以找第三方工具来验证你的文件格式是否正确。</li>
<li>编写相关的函数。<ul>
<li>为你的mib新建一个c文件，可以使用mib2c这样的工具来完成。</li>
<li>如果该OID是只读的，那就在该文件里编写一个只读的函数（mib2c应该会生成的）；如果可写，也应该有一个写的函数（相样是生成的）</li>
</ul>
</li>
</ul>
<h4 id="3-2-Self-defined-Mib"><a href="#3-2-Self-defined-Mib" class="headerlink" title="3.2 Self-defined Mib"></a>3.2 Self-defined Mib</h4><p>I don’t find any good tools for generate mibs, what I do is hacking by hand; if<br>you know some good tool, don’t forget to tell me.</p>
<pre><code>--============================================================
-- Dennis Sample Management Information Base (MIB)
--============================================================

DENNIS-MIB DEFINITIONS ::= BEGIN

IMPORTS
    DisplayString,
    PhysAddress,
    MacAddress,
    DateAndTime,
    RowStatus,
    TEXTUAL-CONVENTION
        FROM SNMPv2-TC
    MODULE-IDENTITY,
    OBJECT-TYPE,
    NOTIFICATION-TYPE,
    Integer32,
    IpAddress,
    TimeTicks,
    Unsigned32
        FROM SNMPv2-SMI;

--============================================================
-- MODULE IDENTITY : dennis
--============================================================

dennis MODULE-IDENTITY
    LAST-UPDATED &quot;201308160000Z&quot;
    ORGANIZATION &quot;MIB&quot;
    CONTACT-INFO
        &quot;Shenzhen, China, Earth village, Solar system
         http://matrix207.github.com
         E-mail: dennis.cpp@gmail.com&quot;
    DESCRIPTION
        &quot;Sample MIB Definition  for
        iso(1).org(3).dod(6).internet(1).private(4).enterprises(1).dennis(9913)&quot;
    ::= { 1  3  6  1  4  1  9913 }


--============================================================
-- Definition of the Sample MIB Common Objects
--============================================================

dennisSampleMib OBJECT IDENTIFIER       ::= { dennis 1 }

--============================================================
-- Definition of the Information Group
--============================================================


dennisSystemInformation OBJECT IDENTIFIER  ::= { dennisSampleMib 1 }

--============================================================
-- Definition of the Information Group (Object type: scalar)
--============================================================

dennisSysInfoEntry OBJECT IDENTIFIER  ::= { dennisSystemInformation 1 }

dennisSystemOSVersion OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (64))
    MAX-ACCESS read-only
    STATUS  current
    DESCRIPTION
        &quot;This object show the operator system version.&quot;
    ::= { dennisSysInfoEntry 1 }


dennisSystemOSBit OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS read-only
    STATUS  current
    DESCRIPTION
        &quot;This object show the operator system bit&quot;
    ::= { dennisSysInfoEntry 2 }


dennisSystemCPU OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS read-only
    STATUS  current
    DESCRIPTION
        &quot;The speed of processor, unit: MHZ&quot;
    ::= { dennisSysInfoEntry 3 }


dennisSystemMemory OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS read-only
    STATUS  current
    DESCRIPTION
        &quot;The total number of memory, unit: MB&quot;
    ::= { dennisSysInfoEntry 4 }


dennisSystemDiskSizy OBJECT-TYPE
    SYNTAX     Integer32
    MAX-ACCESS read-only
    STATUS     current
    DESCRIPTION
        &quot;The total size of disks&quot;
    ::= { dennisSysInfoEntry 5 }


--============================================================
-- Definition of the Directory Group Mount on Root (Object type: table)
--============================================================

dennisSubDirOfRootInformationTable    OBJECT-TYPE
    SYNTAX    SEQUENCE OF DennisSubDirOfRootInformationEntry
    MAX-ACCESS    not-accessible
    STATUS    current
    DESCRIPTION
        &quot;A list of expander chassis information.&quot;
    ::= { dennisSampleMib 2 }


dennisSubDirOfRootInformationEntry    OBJECT-TYPE
    SYNTAX    DennisSubDirOfRootInformationEntry
    MAX-ACCESS    not-accessible
    STATUS    current
    DESCRIPTION
        &quot;A expander chassis information entry&quot;
    INDEX    { dennisSubDirOfRootIndex }
    ::= { dennisSubDirOfRootInformationTable 1 }


DennisSubDirOfRootInformationEntry    ::=
    SEQUENCE {
       dennisSubDirOfRootIndex Integer32,
       dennisSubDirOfRootName  DisplayString,
       dennisSubDirOfRootSize  Integer32,           
       dennisSubDirOfRootDate  DisplayString }

dennisSubDirOfRootIndex OBJECT-TYPE
    SYNTAX    Integer32
    MAX-ACCESS    read-only
    STATUS    current
    DESCRIPTION
        &quot;The index.&quot;
    ::= { dennisSubDirOfRootInformationEntry 1 }

dennisSubDirOfRootName OBJECT-TYPE
    SYNTAX    DisplayString (SIZE (64)) 
    MAX-ACCESS    read-only
    STATUS    current
    DESCRIPTION
        &quot;The type of expander chassis.&quot;
    ::= { dennisSubDirOfRootInformationEntry 2 }

dennisSubDirOfRootSize OBJECT-TYPE
    SYNTAX    Integer32
    MAX-ACCESS    read-only
    STATUS    current
    DESCRIPTION
        &quot;The expander chassis manufacturer&apos;s id.&quot;
    ::= { dennisSubDirOfRootInformationEntry 3 }

dennisSubDirOfRootDate OBJECT-TYPE
    SYNTAX    DisplayString
    MAX-ACCESS    read-only
    STATUS    current
    DESCRIPTION
        &quot;The total number of physical slots for physical
        disk on the chassis.&quot;
    ::= { dennisSubDirOfRootInformationEntry 4 }


--============================================================
-- Definition of access object (Object type: scalar)
--============================================================
dennisAccessObject OBJECT IDENTIFIER  ::= { dennisSampleMib 3 }

dennisShutdownType OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS read-write
    STATUS  current
    DESCRIPTION
        &quot;Use for shudown operator system, 1:shutdown 2:reboot&quot;
        ::= { dennisAccessObject 1 }


--============================================================
-- End Definition
--============================================================
END
</code></pre><h4 id="3-3-Check-mib"><a href="#3-3-Check-mib" class="headerlink" title="3.3 Check mib"></a>3.3 Check mib</h4><pre><code>[root@localhost mib]# snmptranslate -Tp -m DENNIS-MIB
+--iso(1)
   |
   +--anonymous#0(3)
      |
      +--anonymous#1(6)
         |
         +--anonymous#2(1)
            |
            +--anonymous#3(4)
               |
               +--anonymous#4(1)
                  |
                  +--dennis(9913)
                     |
                     +--dennisSampleMib(1)
                        |
                        +--dennisSystemInformation(1)
                        |  |
                        |  +--dennisSysInfoEntry(1)
                        |     |
                        |     +-- -R-- String    dennisSystemOSVersion(1)
                        |     |        Textual Convention: DisplayString
                        |     |        Size: 64
                        |     +-- -R-- Integer32 dennisSystemOSBit(2)
                        |     +-- -R-- Integer32 dennisSystemCPU(3)
                        |     +-- -R-- Integer32 dennisSystemMemory(4)
                        |     +-- -R-- Integer32 dennisSystemDiskSizy(5)
                        |
                        +--dennisSubDirOfRootInformationTable(2)
                        |  |
                        |  +--dennisSubDirOfRootInformationEntry(1)
                        |     |  Index: dennisSubDirOfRootIndex
                        |     |
                        |     +-- -R-- Integer32 dennisSubDirOfRootIndex(1)
                        |     +-- -R-- String    dennisSubDirOfRootName(2)
                        |     |        Textual Convention: DisplayString
                        |     |        Size: 64
                        |     +-- -R-- Integer32 dennisSubDirOfRootSize(3)
                        |     +-- -R-- String    dennisSubDirOfRootDate(4)
                        |              Textual Convention: DisplayString
                        |              Size: 0..255
                        |
                        +--dennisAccessObject(3)
                           |
                           +-- -RW- Integer32 dennisShutdownType(1)
</code></pre><h2 id="4-Use-mib2c"><a href="#4-Use-mib2c" class="headerlink" title="4. Use mib2c"></a>4. Use mib2c</h2><h4 id="4-1-mib-object"><a href="#4-1-mib-object" class="headerlink" title="4.1 mib object"></a>4.1 mib object</h4><p>scalar: int,  string,  time and so on.<br>table : table has row and column, like table in database.  </p>
<h4 id="4-2-use-mib2c-to-create-source-file"><a href="#4-2-use-mib2c-to-create-source-file" class="headerlink" title="4.2 use mib2c to create source file"></a>4.2 use mib2c to create source file</h4><p><strong>append string “DENNIS-MIB” to config file: snmpd.conf</strong><br><code>su -c &#39;vim /etc/snmp/snmpd.conf&#39;</code>  </p>
<p><strong>copy mib file to mibs directory(depend on which directory mib2c installed)</strong><br><code>su -c &#39;cp DENNIS-MIB.txt /usr/local/share/snmp/mibs/&#39;</code>  </p>
<p><strong>generate c source file by mib2c</strong><br><code>mib2c -c mib2c.scalar.conf DENNIS-MIB::dennis</code>  for scalar object<br><code>mib2c -c mib2c.old-api.conf DENNIS-MIB::dennis</code> for scalar  object<br><code>mib2c -c mib2c.iterate.conf DENNIS-MIB::dennis</code> for table  object (choise 2)<br><code>mib2c -c mib2c.notify.conf DENNIS-MIB::dennis</code> for trapping message<br>if failed to translate, check the mibs directory again, or look the output message.</p>
<p>more configure files, look as below:  </p>
<pre><code>[dennis@localhost net-snmp-5.4.2]$ ls /usr/local/share/snmp/*.conf
/usr/local/share/snmp/mib2c.access_functions.conf    
/usr/local/share/snmp/mib2c.int_watch.conf
/usr/local/share/snmp/mib2c.array-user.conf          
/usr/local/share/snmp/mib2c.iterate_access.conf
/usr/local/share/snmp/mib2c.check_values.conf        
/usr/local/share/snmp/mib2c.iterate.conf
/usr/local/share/snmp/mib2c.check_values_local.conf  
/usr/local/share/snmp/mib2c.mfd.conf
/usr/local/share/snmp/mib2c.column_defines.conf      
/usr/local/share/snmp/mib2c.notify.conf
/usr/local/share/snmp/mib2c.column_enums.conf        
/usr/local/share/snmp/mib2c.old-api.conf
/usr/local/share/snmp/mib2c.column_storage.conf      
/usr/local/share/snmp/mib2c.perl.conf
/usr/local/share/snmp/mib2c.conf                     
/usr/local/share/snmp/mib2c.raw-table.conf
/usr/local/share/snmp/mib2c.container.conf           
/usr/local/share/snmp/mib2c.scalar.conf
/usr/local/share/snmp/mib2c.create-dataset.conf      
/usr/local/share/snmp/mib2c.table_data.conf
/usr/local/share/snmp/mib2c.genhtml.conf             
/usr/local/share/snmp/snmptrapd.conf
</code></pre><h2 id="5-Add-self-defined-mib-library"><a href="#5-Add-self-defined-mib-library" class="headerlink" title="5. Add self-defined mib library"></a>5. Add self-defined mib library</h2><h4 id="5-1-steps"><a href="#5-1-steps" class="headerlink" title="5.1 steps:"></a>5.1 steps:</h4><p>使用net-snmp扩展私有MIB的大致方法<br>参考： <a href="http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/mib_module/index.html" target="_blank" rel="external">net-snmp tutorial</a></p>
<p>step 1. 首先需要使用net-snmp的相关API编写MIB相关C代码，</p>
<pre><code>1. MFD/mib2c：这是一种通过net-snmp提供的mib2c程序自动生成相关代码的方式
2. A simple scalar attached to a variable：适合于简单变量类型的object
3. A simple scalar with the value returned from code：适用于任何变量类型的object
</code></pre><p>step 2. 然后将刚写的MIB C code编译进net-snmp，有几种方法：</p>
<pre><code>1. compile it into master agent：
  1）将刚编写的码加入net-snmp的src目录，
  2）通过configure的option指示make编译该mib，
     如./configure --with-mib-modules=&quot;myobject&quot; 
  3）make
  4）make install
  这样，你的MIB就已经被内置如snmp服务程序中了，MIB的生效也就理所当然

2. compile your code into a “subagent”：
  这种方式可以将subagent通过agentx协议与master agent通信，
  参考： http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demon/index.html
  这种情况subagent最终是一个独立的application，包含两种生成方式，
  1).是通过net-snmp-config工具生成；
  2).是自己编写程序控制调用；
  后者更为灵活，subagent功能可以被集成在其它application中。

3. compile your code into pluggable shared object and tell the snmpd agent to load it
  这种方式最后生成一个.so的共享库，用户启动snmpd服务时可以通过指定参数的方式
  加载该共享库以扩展MIB，
  参考： http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/dlmod/index.html 
</code></pre><h4 id="5-2-compile-net-snmp-by-shell-script"><a href="#5-2-compile-net-snmp-by-shell-script" class="headerlink" title="5.2 compile net-snmp by shell script"></a>5.2 compile net-snmp by shell script</h4><pre><code>cd /home/dennis/net-snmp-5.4.2/
cp -f /home/dennis/dennis.{h,c} ./agent/mibgroup
./configure --prefix=/usr --with-mib-modules=&quot;dennis&quot;
make clean
make
make install
</code></pre><h4 id="5-3-update-mib"><a href="#5-3-update-mib" class="headerlink" title="5.3 update mib"></a>5.3 update mib</h4><pre><code>copy &quot;net-snmp-5.4.2/agent/.libs/libnetsnmpmibs.so&quot; to &quot;/usr/lib/&quot;,  
64bit system is to &quot;/usr/lib64/&quot;
</code></pre><h4 id="5-4-check-the-so-had-have-the-interfaces-which-you-implement"><a href="#5-4-check-the-so-had-have-the-interfaces-which-you-implement" class="headerlink" title="5.4 check the so had have the interfaces which you implement"></a>5.4 check the so had have the interfaces which you implement</h4><pre><code>[root@ ~]# which snmpd
/usr/sbin/snmpd
[root@ ~]# ldd /usr/sbin/snmpd | grep libnetsnmpmib
    libnetsnmpmibs.so.15 =&gt; /usr/lib64/libnetsnmpmibs.so.15 (0x0000003655600000)
[root@ ~]# nm /usr/lib64/libnetsnmpmibs.so.15 | grep &quot;YOUR_INTERFACE_KEY&quot;
</code></pre><h4 id="5-5-check-config-file"><a href="#5-5-check-config-file" class="headerlink" title="5.5 check config file"></a>5.5 check config file</h4><pre><code>check the file /etc/snmp/snmpd.conf, append `rwcommunity private` to it to 
make access authority for `snmpset`.
</code></pre><h4 id="5-6-restart-snmp"><a href="#5-6-restart-snmp" class="headerlink" title="5.6 restart snmp"></a>5.6 restart snmp</h4><pre><code>/usr/sbin/snmpd -c /etc/snmp/snmpd.conf -Le
</code></pre><h2 id="6-Improve-speed"><a href="#6-Improve-speed" class="headerlink" title="6. Improve speed"></a>6. Improve speed</h2><p>When snmp agent receive lots of request, and if do some I/O operation of each<br>request, that will show a low performance.<br>One not-bad solution is use a thread do the I/O job, and store the information<br>to memory (using global variable, array, structure …), then fill info and<br>return to client when get the request.</p>
<h4 id="6-1-add-thread-function-to-mib-file"><a href="#6-1-add-thread-function-to-mib-file" class="headerlink" title="6.1 add thread function to mib file"></a>6.1 add thread function to mib file</h4><p>Add include <code>#include &lt;pthread.h&gt;</code> to the mib file<br>Write thread function like this: <code>void *update_all_info (void *parm);</code></p>
<h4 id="6-2-modify-Makefile"><a href="#6-2-modify-Makefile" class="headerlink" title="6.2 modify Makefile"></a>6.2 modify Makefile</h4><p>Add link library(<code>-lpthread</code>) to agent/Makefile (line:199):<br><code>LOCAL_LIBS    = -L../snmplib/.libs -L../snmplib -L./.libs -L./helpers/.libs -L./helpers -lpthread</code></p>
<h2 id="7-Reference"><a href="#7-Reference" class="headerlink" title="7. Reference"></a>7. Reference</h2><h4 id="7-1-network-link"><a href="#7-1-network-link" class="headerlink" title="7.1 network link"></a>7.1 network link</h4><ul>
<li><a href="http://imxie.net/2011/07/use_pass_for_snmp_get_and_set.htm" target="_blank" rel="external">net-snmp之利用pass做snmpget和snmpset</a></li>
<li><a href="http://www.linuxfly.org/post/556/" target="_blank" rel="external">自定义SNMP Agent</a></li>
<li><a href="http://bbs.csdn.net/topics/300080590" target="_blank" rel="external">net-snmp中如何加自定义的mib</a></li>
<li><a href="http://blog.csdn.net/linyt/article/details/2842244" target="_blank" rel="external">Extending the UCD-SNMP(net-snmp)agent</a></li>
<li><a href="http://www.net-snmp.org/wiki/index.php/Tutorials" target="_blank" rel="external">Tutorial</a></li>
<li><a href="http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_MIB_Module" target="_blank" rel="external">Writing a MIB Module</a></li>
<li><a href="http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/mib_module/index.html" target="_blank" rel="external">Writing a net-snmp MIB Modul</a></li>
<li><a href="http://blog.csdn.net/bearfig/article/details/2080421" target="_blank" rel="external">在net-snmp agent中扩展自己的mib</a></li>
<li><a href="http://bibu.bokee.com/inc/net_snmp_doc.htm" target="_blank" rel="external">用NET-SNMP软件包开发简单客户端代理★★★★</a></li>
<li><a href="http://bibu.bokee.com/inc/net_snmp_doc.htm#_Toc116812027" target="_blank" rel="external">利用NET-SNMP开发代理(原创</a></li>
<li><a href="http://www.tonylin.idv.tw/dokuwiki/doku.php/snmp:snmp:mibhelloworld" target="_blank" rel="external">第一次寫MIB就上手★★★★</a></li>
<li><a href="http://blog.csdn.net/dumeifang/article/details/4201860" target="_blank" rel="external">FreeBSD snmptrapd.conf配置详解</a></li>
<li><a href="http://velep.com/archives/585.html" target="_blank" rel="external">snmptrap、snmpinform和snmptrapd的详细介绍及其用法</a></li>
<li><a href="http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent" target="_blank" rel="external">Writing a subagent</a></li>
<li><a href="http://blog.csdn.net/BeyondHaven/article/details/10575601" target="_blank" rel="external">windows下使用net-snmp实现agent扩展 一</a></li>
<li><a href="http://wenku.baidu.com/view/4da5e14df7ec4afe04a1df66.html?from_page=view&amp;from_mod=download###" target="_blank" rel="external">net-snmp在windows上的配置开发及详细的代码流程</a></li>
<li><a href="http://wendang.baidu.com/view/83ee071cfc4ffe473368ab8c.html" target="_blank" rel="external">Windows下使用net-snmp所遇问题及解决</a></li>
<li><a href="http://blog.csdn.net/jxzxm1_2/article/details/2948522" target="_blank" rel="external">VS2005下编译、安装Net-snmp 5.4.1.2手记</a></li>
<li><a href="http://hi.baidu.com/lieyu063/item/e00625c245ee2544a9ba94a0" target="_blank" rel="external">Net-SNMP的第一个agent实现</a></li>
<li><a href="http://blog.csdn.net/sstower/article/details/4791844" target="_blank" rel="external">net-snmp中自定义snmp table的实现</a></li>
<li><a href="http://blog.sina.com.cn/s/blog_8f3de3250100xhao.html" target="_blank" rel="external">net-snmp代理开发——自定义table实现</a></li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2013/04/19/net-snmp/" data-id="ciqqpe1j6004hnmpvwv9ny7wn" class="article-share-link">Partager</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/network/">network</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2013/04/28/nodejs/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Récent</strong>
      <div class="article-nav-title">
        
          node.js
        
      </div>
    </a>
  
  
    <a href="/2013/04/10/get-mac-with-netbios/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Ancien</strong>
      <div class="article-nav-title">get mac with NetBIOS</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Catégories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/english/">english</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/kernel/">kernel</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/language/">language</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/math/">math</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/network/">network</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/others/">others</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/person/">person</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/program/">program</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/source/">source</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/storage/">storage</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/tools/">tools</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/windows/">windows</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Mot-clés</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/FAQ/">FAQ</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/IRC/">IRC</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Translation/">Translation</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/android/">android</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/api/">api</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/assembly/">assembly</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/awk/">awk</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/batch/">batch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/blog/">blog</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/book/">book</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/c/">c</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/c/">c++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/crash/">crash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/debug/">debug</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dot/">dot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/driver/">driver</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/emacs/">emacs</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/exploit/">exploit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/file-system/">file system</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/filesystem/">filesystem</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/flowchart/">flowchart</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gcc/">gcc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/google/">google</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/graphviz/">graphviz</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hosts/">hosts</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/iscsi/">iscsi</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javascript/">javascript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/job/">job</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/json/">json</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kernel/">kernel</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/lisp/">lisp</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/lua/">lua</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/makefile/">makefile</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/malloc/">malloc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/math/">math</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/maxima/">maxima</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memory/">memory</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memory-overflow/">memory overflow</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mtrace/">mtrace</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netdisk/">netdisk</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/network/">network</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/others/">others</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pandoc/">pandoc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/performance/">performance</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/person/">person</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rsync/">rsync</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sed/">sed</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/shell/">shell</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/skype/">skype</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sms/">sms</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/source/">source</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ssh/">ssh</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/stack/">stack</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/storage/">storage</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/study/">study</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/svn/">svn</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sync/">sync</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/test/">test</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/time/">time</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tools/">tools</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/valgrind/">valgrind</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vi/">vi</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vim/">vim</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/virtual/">virtual</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wget/">wget</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/windows/">windows</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wireshark/">wireshark</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/write/">write</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xml/">xml</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Nuage de mot-clés</h3>
    <div class="widget tagcloud">
      <a href="/tags/FAQ/" style="font-size: 10px;">FAQ</a> <a href="/tags/IRC/" style="font-size: 10px;">IRC</a> <a href="/tags/Translation/" style="font-size: 13px;">Translation</a> <a href="/tags/android/" style="font-size: 10px;">android</a> <a href="/tags/api/" style="font-size: 10px;">api</a> <a href="/tags/assembly/" style="font-size: 10px;">assembly</a> <a href="/tags/awk/" style="font-size: 11px;">awk</a> <a href="/tags/batch/" style="font-size: 14px;">batch</a> <a href="/tags/blog/" style="font-size: 10px;">blog</a> <a href="/tags/book/" style="font-size: 10px;">book</a> <a href="/tags/c/" style="font-size: 16px;">c</a> <a href="/tags/c/" style="font-size: 19px;">c++</a> <a href="/tags/cache/" style="font-size: 10px;">cache</a> <a href="/tags/crash/" style="font-size: 10px;">crash</a> <a href="/tags/database/" style="font-size: 17px;">database</a> <a href="/tags/debug/" style="font-size: 12px;">debug</a> <a href="/tags/dot/" style="font-size: 10px;">dot</a> <a href="/tags/driver/" style="font-size: 10px;">driver</a> <a href="/tags/emacs/" style="font-size: 11px;">emacs</a> <a href="/tags/exploit/" style="font-size: 10px;">exploit</a> <a href="/tags/file-system/" style="font-size: 10px;">file system</a> <a href="/tags/filesystem/" style="font-size: 12px;">filesystem</a> <a href="/tags/flowchart/" style="font-size: 10px;">flowchart</a> <a href="/tags/gcc/" style="font-size: 10px;">gcc</a> <a href="/tags/git/" style="font-size: 12px;">git</a> <a href="/tags/google/" style="font-size: 11px;">google</a> <a href="/tags/graphviz/" style="font-size: 11px;">graphviz</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/hosts/" style="font-size: 10px;">hosts</a> <a href="/tags/iscsi/" style="font-size: 14px;">iscsi</a> <a href="/tags/java/" style="font-size: 10px;">java</a> <a href="/tags/javascript/" style="font-size: 10px;">javascript</a> <a href="/tags/job/" style="font-size: 10px;">job</a> <a href="/tags/json/" style="font-size: 10px;">json</a> <a href="/tags/kernel/" style="font-size: 14px;">kernel</a> <a href="/tags/linux/" style="font-size: 14px;">linux</a> <a href="/tags/lisp/" style="font-size: 10px;">lisp</a> <a href="/tags/lua/" style="font-size: 10px;">lua</a> <a href="/tags/makefile/" style="font-size: 10px;">makefile</a> <a href="/tags/malloc/" style="font-size: 10px;">malloc</a> <a href="/tags/math/" style="font-size: 11px;">math</a> <a href="/tags/maxima/" style="font-size: 10px;">maxima</a> <a href="/tags/memory/" style="font-size: 11px;">memory</a> <a href="/tags/memory-overflow/" style="font-size: 10px;">memory overflow</a> <a href="/tags/mtrace/" style="font-size: 10px;">mtrace</a> <a href="/tags/netdisk/" style="font-size: 10px;">netdisk</a> <a href="/tags/network/" style="font-size: 20px;">network</a> <a href="/tags/others/" style="font-size: 18px;">others</a> <a href="/tags/pandoc/" style="font-size: 10px;">pandoc</a> <a href="/tags/performance/" style="font-size: 16px;">performance</a> <a href="/tags/person/" style="font-size: 11px;">person</a> <a href="/tags/protobuf/" style="font-size: 11px;">protobuf</a> <a href="/tags/python/" style="font-size: 10px;">python</a> <a href="/tags/rsync/" style="font-size: 10px;">rsync</a> <a href="/tags/sed/" style="font-size: 11px;">sed</a> <a href="/tags/shell/" style="font-size: 15px;">shell</a> <a href="/tags/skype/" style="font-size: 11px;">skype</a> <a href="/tags/sms/" style="font-size: 10px;">sms</a> <a href="/tags/source/" style="font-size: 11px;">source</a> <a href="/tags/ssh/" style="font-size: 10px;">ssh</a> <a href="/tags/stack/" style="font-size: 10px;">stack</a> <a href="/tags/storage/" style="font-size: 15px;">storage</a> <a href="/tags/study/" style="font-size: 10px;">study</a> <a href="/tags/svn/" style="font-size: 11px;">svn</a> <a href="/tags/sync/" style="font-size: 10px;">sync</a> <a href="/tags/test/" style="font-size: 11px;">test</a> <a href="/tags/time/" style="font-size: 10px;">time</a> <a href="/tags/tools/" style="font-size: 16px;">tools</a> <a href="/tags/valgrind/" style="font-size: 10px;">valgrind</a> <a href="/tags/vi/" style="font-size: 10px;">vi</a> <a href="/tags/vim/" style="font-size: 14px;">vim</a> <a href="/tags/virtual/" style="font-size: 11px;">virtual</a> <a href="/tags/wget/" style="font-size: 10px;">wget</a> <a href="/tags/windows/" style="font-size: 11px;">windows</a> <a href="/tags/wireshark/" style="font-size: 10px;">wireshark</a> <a href="/tags/write/" style="font-size: 13px;">write</a> <a href="/tags/xml/" style="font-size: 10px;">xml</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/">July 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">April 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">March 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/02/">February 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">October 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">September 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/07/">July 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/06/">June 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/03/">March 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/02/">February 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/01/">January 2015</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/12/">December 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">November 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/09/">September 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/08/">August 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/07/">July 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/06/">June 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/05/">May 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/04/">April 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/03/">March 2014</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/11/">November 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/10/">October 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/09/">September 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/08/">August 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/07/">July 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/06/">June 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/05/">May 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/04/">April 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/03/">March 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/02/">February 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/01/">January 2013</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/12/">December 2012</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/09/">September 2012</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Articles récents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/07/17/how-to-implement-malloc/">如何实现一个malloc</a>
          </li>
        
          <li>
            <a href="/2016/07/17/study-grep-more/">grep工作原理</a>
          </li>
        
          <li>
            <a href="/2016/07/17/2016-04-13-malloc/">malloc</a>
          </li>
        
          <li>
            <a href="/2016/04/27/include-what-you-use/">使用IWYU整理头文件引用</a>
          </li>
        
          <li>
            <a href="/2016/04/24/understand-gcc-assembly-output/">understand gcc assembly output</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 Matrix207<br>
      Propulsé by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>